package com.fcscs.cservice.service.impl;

import com.fcscs.core.util.CommonUtil;

public class ManagerContextValueUtil {
	
	public static long getUserId(){
		long userId = 0L;
		if (CommonUtil.getUserContext() != null){
			userId = CommonUtil.getUserContext().getUserId();
		}else if (CommonUtil.getWsSessionUserId() != null) {
			userId = CommonUtil.getWsSessionUserId().longValue();
		}
		return userId;
	}
	
	public static long getOrgId() {
		long orgId = 0L;
		if (CommonUtil.getUserContext() != null){
			orgId = CommonUtil.getUserContext().getOrgId();
		}else if (CommonUtil.getWsSessionOrgId() != null) {
			orgId = CommonUtil.getWsSessionOrgId().longValue();
		}
		return orgId;
	}
	
	public static Long getPropId() {
		Long propId = 0L;
		if (CommonUtil.getUserContext() != null){
			propId = CommonUtil.getUserContext().getPropertyId();
		}else if (CommonUtil.getWsSessionOrgId() != null) {
			propId = CommonUtil.getWsSessionPropertyId().longValue();
		}
		return propId;
	}
}
